package com.s08.h01.utils;

import java.util.Collection;
import java.util.List;

import com.s08.h01.model.GoldUser;
import com.s08.h01.model.StandardUser;
import com.s08.h01.model.User;

public class UserUtils {

	public static void listUsers(Collection<User> users) {

		for (User user : users) {
			System.out.println(user);

			if (user instanceof StandardUser) {
				System.out
						.println(((StandardUser) user).showDiscountProducts());
			}
		}
	}

	public static void listUsersProducts(Collection<User> users) {

		for (User user : users) {

			System.out.println(user);

			if (user instanceof GoldUser) {
				System.out.println(((GoldUser) user).showExtraProducts());
				System.out.println(user.showDiscountedProducts());
			} else
				System.out.println(user.showProducts());

		}

	}
}
